<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>


<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>基本信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" type="text/css" href="../../../css/sys/userInfor.css"/>
    <link rel="stylesheet" type="text/css" href="../../../css/hr/index.css"/>
    <script src="../../../js/jquery/jquery-1.9.1.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/sys/userInfor.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../lib/laydate/laydate.js"></script>
    <script src="../../../lib/jquery.form.min.js"></script>
    <script src="../../lib/pagination/js/jquery.pagination.min.js" type="text/javascript" charset="utf-8"></script>




    <style>
        html,body{
            height:100%;
        }
        .btn_{
            width:300px;display: block;
        }
        .leave_send{
            display: inline-block;
            float: left;
            width: 66px;
            height: 30px;
            margin-right: 0px;
            margin-top: 10px;
            margin-bottom: 20px;
            background: url(../../../img/publish.png) no-repeat;
            padding-left: 47px;
            padding-top: 7px;
            cursor: pointer;
            font-size: 14px;
        }
        #downChild .dpetWhole0 .childdept{
            padding-left: 60px!important;
        }
        #downChild .dpetWhole0 ul .childdept{
            padding-left: 80px!important;
        }
        #downChild .dpetWhole0 ul ul li .childdept{
            padding-left: 95px!important;
        }
        .left {
            width: 21.5%;
            border-right: 1px solid #ccc;
            overflow-y: auto;
        }
        .rig {
            width: 100%;
        }
        .colorDis{
            background-color: #e7e7e7;
        }
        table input{
            width: auto;
        }
        .allCondition{
            width: 1200px;
            margin-left: 20px;
        }
        /*.biaoge{  border:1px solid red;  border-collapse:collapse;}*/
        /*.biaoge tbody tr td{ border:1px solid red; }*/
        .text_width{width:126px;}
        .loopData{
            font-size: 11pt;
        }



        table.TableBlock tr td:nth-child(2){
            width: 35%;
        }

        /**
        寇义东
        2018.08.01
         */
        #queryArchives, #mans{
            height: 35px;
            line-height: 35px;
            cursor: pointer;
        }

        .queryArchivesTitle, .mansTitle{
            display: inline-block;
        }
        .queryArchivesIcon, .mansIcon{
            padding-left: 10px;
        }


        .rig{
            width: 100%;
            overflow-y: auto;
        }
        #add_send, #leave_send{
            width: auto !important;
            height: auto !important;
            background:none;
            border: 1px solid #ccc;
            border-radius: 4px;
            padding: 5px 10px;

        }

    </style>


    <script>
        function newtime(val) {
//            console.log($(val).val())
            var date = new Date($(val).val());
            // 有三种方式获取
            var time1 = date.getTime();

            var datanew=new Date();


        }
    </script>
</head>
<body>

    <div class="cont">
        <div class="rig">
            <div class="table_personDetail" style="display: block" id="table_personDetail">
                <table class="TableBlock biaoge" width="100%" align="center">
                    <tbody>
                    <tr>
                        <td nowrap="" class="TableHeader" colspan="6"><b>&nbsp;基本信息</b></td>
                    </tr>
                    <tr >
                        <td nowrap="" class="TableData text_width test_text">姓名：</td>
                        <td class="TableData">
                            <input type="text" name="STAFF_NAME"  value="" class="BigStatic per_name test_null" ><span style="color: #FF0000;margin-left: 10px;font-size: 16px;">*</span>
                        </td>
                        <td nowrap="" class="TableData text_width test_text" >所属部门：</td>
                        <td class="TableData"  width="180">
                            <input type="hidden" name="DEPT_ID" id="DEPT_ID" class="dept_id">
                            <input type="text" name="DEPT_NAME" value="" id="DEPT_NAME"  class="BigStatic company dept_name test_null" size=12 maxlength=100>
                            <span style="color: #FF0000;margin-left: 10px;font-size: 16px;">*</span>
                        </td>
                    </tr>
                    <tr>
                        <td nowrap="" class="TableData text_width test_text" >角色：</td>
                        <td class="TableData"  width="180">
                            <input type="hidden" name="USER_PRIV" value="" class="userPriv">
                            <input type="text" name="USER_PRIV_NAME"  style="background-color: #e7e7e7;" value="" id="USER_PRIV_NAME" class="BigStatic company userPrivName test_null" size=12 maxlength=100 readonly="">
                            <span style="color: #FF0000;margin-left: 10px;font-size: 16px;">*</span>
                            <a href="javascript:;" class="orgAdd userPriv_add" id="userPriv_add">添加</a>
                        <td nowrap="" class="TableData text_width">工号：</td>
                        <td class="TableData"><input type="text" name="WORK_NO" value="" class="BigInput per_worknum"></td>
                    </tr>
                    <tr>
                        <td nowrap="" class="TableData text_width">曾用名：</td>
                        <td class="TableData" ><input type="text" name="BEFORE_NAME" value="" class="BigInput per_overname"></td>
                        <td nowrap="" class="TableData text_width">英文名：</td>
                        <td class="TableData"><input type="text" name="STAFF_E_NAME" value="" class="BigInput per_engname"></td>
                    </tr>
                    <tr>
                        <td nowrap="" class="TableData text_width">身份证号：</td>
                        <td class="TableData">
                            <input type="text" name="STAFF_CARD_NO" id="STAFF_CARD_NO" class="BigInput per_ident" value="" onblur="check()">
                        </td>
                        <td nowrap="" class="TableData text_width">编号：</td>
                        <td class="TableData dept" width="80%">
                            <input type="text" name="STAFF_NO" value="" class="BigInput per_num">
                        </td>
                    </tr>


                    <tr>
                        <td nowrap="" class="TableData text_width">性别：</td>
                        <td class="TableData" title="填写完身份证号码后可直接生成">
                            <select style="width:218px;" name="STAFF_SEX" class="BigSelect per_sex">
                                <option value="0" selected="">男</option>
                                <option value="1">女</option>
                            </select>
                        </td>
                        <td nowrap="" class="TableData text_width">年龄：</td>
                        <td class="TableData" title="填写完身份证号码后可直接生成"><input type="text" name="STAFF_AGE" size="4" class="BigInput per_age" value=""><span style="margin-left: 4px;font-size:12px;line-height: 28px;color:#999;">岁</span></td>
                    </tr>
                    <tr>
                        <td nowrap="" class="TableData text_width">出生日期：</td>
                        <td class="TableData" title="填写完身份证号码后可直接生成">
                            <input type="text" name="STAFF_BIRTH" id="STAFF_BIRTH" size="10" maxlength="10" class="BigInput per_date" value="" onclick="laydate({istime: true, format: 'YYYY-MM-DD',choose:get_animal_sign})" onchange="get_animal_sign()">
                        </td>
                        <td nowrap="" class="TableData text_width" >户口所在地：</td>
                        <td class="TableData" width="180"><input type="text" name="STAFF_DOMICILE_PLACE" value="" size="40" class="BigInput per_hukouAdd"></td>
                    </tr>
                    <tr>
                        <td nowrap="" class="TableData text_width" >年休假：</td>
                        <td class="TableData">
                            <input type="text" name="LEAVE_TYPE" size="4" maxlength="4" class="BigInput per_yearjia" value="0"></td>
                        <td nowrap="" class="TableData text_width">籍贯：</td>
                        <td class="TableData"  nowrap="">
                            <select style="width:218px;" name="STAFF_NATIVE_PLACE" class="BigSelect per_address" title="<fmt:message code="hr.th.OriginIn" />。">
                                <option value="" selected=""></option>
                                <option value="110000">北京</option>
                                <option value="120000">天津</option>
                                <option value="130000">河北</option>
                                <option value="140000">山西</option>
                                <option value="150000">内蒙古</option>
                                <option value="210000">辽宁</option>
                                <option value="220000">吉林</option>
                                <option value="230000">黑龙江</option>
                                <option value="310000">上海</option>
                                <option value="320000">江苏</option>
                                <option value="330000">浙江</option>
                                <option value="340000">安徽</option>
                                <option value="350000">福建</option>
                                <option value="360000">江西</option>
                                <option value="370000">山东</option>
                                <option value="410000">河南</option>
                                <option value="420000">湖北</option>
                                <option value="430000">湖南</option>
                                <option value="440000">广东</option>
                                <option value="450000">广西</option>
                                <option value="460000">海南</option>
                                <option value="500000">重庆</option>
                                <option value="510000">四川</option>
                                <option value="520000">贵州</option>
                                <option value="530000">云南</option>
                                <option value="540000">西藏</option>
                                <option value="610000">陕西</option>
                                <option value="620000">甘肃</option>
                                <option value="630000">青海</option>
                                <option value="640000">宁夏</option>
                                <option value="650000">新疆</option>
                                <option value="710000">台湾</option>
                                <option value="810000">香港</option>
                                <option value="820000">澳门</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td nowrap="" class="TableData text_width">民族：</td>
                        <td class="TableData"><input type="text" name="STAFF_NATIONALITY" class="BigInput per_minzu" value=""></td>
                        <td nowrap="" class="TableData text_width">婚姻状况：</td>
                        <td class="TableData" width="180">
                            <select  style="width:218px;"   name="STAFF_MARITAL_STATUS" class="BigSelect per_hunyin">
                                <option value="" selected=""></option>
                                <option value="0">未婚</option>
                                <option value="1">已婚</option>
                                <option value="2">离异</option>
                                <option value="3">丧偶</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td nowrap="" class="TableData text_width" width="100">健康状况：</td>
                        <td class="TableData"><input type="text" name="STAFF_HEALTH" value="" class="BigInput per_health"></td>
                        <td nowrap="" class="TableData text_width">政治面貌：</td>
                        <td class="TableData" width="180">
                            <select style="width:218px;" name="STAFF_POLITICAL_STATUS" class="BigSelect per_zhengzhi" title="政治面貌可在“人力资源设置”->“HRMS代码设置”模块设置。">
                                <option value="" selected=""></option>
                                <option value="1"><fmt:message code="hr.th.TheMasses" /></option>
                                <option value="2"><fmt:message code="hr.th.Communist" /></option>
                                <option value="3"><fmt:message code="hr.th.CPCMembers" /></option>
                                <option value="4"><fmt:message code="hr.th.CPCProbationaryParty" /></option>
                                <option value="5"><fmt:message code="hr.th.DemocraticParties" /></option>
                                <option value="6"><fmt:message code="hr.th.PersonagesWithoutParty" /></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td nowrap="" class="TableData text_width" >入党时间：</td>
                        <td class="TableData">
                            <input type="text" name="JOIN_PARTY_TIME" size="10" maxlength="10" class="BigInput per_dang" value="" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})">
                        </td>
                        <td nowrap="" class="TableData text_width" ><fmt:message code="hr.th.Incumbency" />：</td>
                        <td class="TableData"  colspan="3">
                            <select style="width:218px;" name="WORK_STATUS" class="BigSelect per_zaizhizhuangtai" title="<fmt:message code="hr.th.InTheState" />。">
                                <option value="" selected=""></option>
                                <option value="01"><fmt:message code="hr.th.Job" /></option>
                                <option value="02"><fmt:message code="hr.th.Resignation" /></option>
                                <option value="03"><fmt:message code="hr.th.Retired" /></option>
                                <option value="04"><fmt:message code="hr.th.retire" /></option>
                                <option value="05"><fmt:message code="hr.th.ToLoan" /></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td nowrap="" class="TableData text_width"  ><fmt:message code="hr.th.TypeWork" />：</td>
                        <td class="TableData" width="180" ><input type="text" name="WORK_TYPE" class="BigInput per_gongzhong" value=""></td>
                        <td nowrap="" class="TableData text_width"  ><fmt:message code="hr.th.AdministrativeLevel" />：</td>
                        <td class="TableData" colspan="3" ><input type="text" name="ADMINISTRATION_LEVEL" class="BigInput per_xingzheng" value=""></td>

                    </tr>
                    <tr>
                        <td nowrap="" class="TableData text_width"  ><fmt:message code="hr.th.EmployeeType" />：</td>
                        <td class="TableData" >
                            <select style="width:218px;" name="STAFF_OCCUPATION" class="BigSelect per_yuangongType" title="<fmt:message code="hr.th.Employees" />。">
                                <option value="" selected=""></option>
                                <option value="01"><fmt:message code="hr.th.ContractWorker" /></option>
                                <option value="02"><fmt:message code="hr.th.RegularEmployee" /></option>
                                <option value="03"><fmt:message code="hr.th.TemporaryWorker" /></option>
                            </select>
                        </td>
                        <td nowrap="" class="TableData text_width" ><fmt:message code="hr.th.InductionTime" />：</td>
                        <td class="TableData" colspan="3">
                            <input type="text" name="DATES_EMPLOYED" size="10" maxlength="10" class="BigInput per_ruzhiTime" value="" onclick="laydate({istime: true, format: 'YYYY-MM-DD',choose:function(dates){
                                var date=new Date();
                                var year=date.getTime();
                                var oldYear=Number(new Date(dates).getTime());
                                var time=(year-oldYear) / 1000 / 60 / 60 / 24 /365;
                                var times=time.toFixed(1);
                                 times=Math.ceil(times)
                                $('.per_gongling').val(times)
                            }})">
                        </td>
                    </tr>

                    <tr>
                        <td nowrap="" class="TableData text_width" ><fmt:message code="userDetails.th.post" />：</td>
                        <td class="TableData" width="180" style="text-align: left;"><select   style="width:218px;"  type="text" name="JOB_POSITION" class="BigInput per_zhiwu"></select></td>
                        <td nowrap="" class="TableData text_width" ><fmt:message code="hr.th.Title" />：</td>
                        <td class="TableData"  colspan="3">
                            <select style="width:218px;" name="PRESENT_POSITION" class="BigSelect per_zhicheng" title="<fmt:message code="hr.th.TheTitle" />。">
                                <option value="" selected=""></option>
                                <option value="08"><fmt:message code="hr.th.SeniorTitles" /></option>
                                <option value="02"><fmt:message code="hr.th.AssistantEngineer" /></option>
                                <option value="01"><fmt:message code="hr.th.Engineer" /></option>
                                <option value="03"><fmt:message code="hr.th.SeniorEngineer" /></option>
                                <option value="04"><fmt:message code="hr.th.Senior" /></option>
                                <option value="07"><fmt:message code="hr.th.Title" /></option>
                            </select>
                        </td>
                    </tr>

                    <tr>

                        <td nowrap="" class="TableData text_width test_text" ><fmt:message code="hr.th.WorkingHours" />：</td>
                        <td class="TableData"  colspan="3">
                            <input type="text" name="JOB_BEGINNING" size="10"  maxlength="10"  class="BigInput per_joinWork " value="" onclick="laydate({istime: true, format: 'YYYY-MM-DD',choose:function(dates){
                                var date=new Date();
                                var year=date.getTime();
                                var oldYear=Number(new Date(dates).getTime());
                                var time=(year-oldYear) / 1000 / 60 / 60 / 24 /365;
                                var times=time.toFixed(1);
                                times=Math.ceil(times)
                                $('.per_allage').val(times)
                            }})" onchange="get_work_age(this.value)">
                        </td>
                    </tr>
                    <tr>
                        <td nowrap="" class="TableData text_width" ><fmt:message code="hr.th.LengthUnit" />：</td>
                        <td class="TableData" width="180"><input type="text" name="JOB_AGE" class="BigInput per_gongling" value=""></td>
                        <td nowrap="" class="TableData text_width" ><fmt:message code="hr.th.TotalLengthOfService" />：</td>
                        <td class="TableData" width="180"><input type="text" name="WORK_AGE" value="" class="BigInput per_allage"></td>
                    </tr>
                    <tr>
                        <td nowrap="" class="TableData text_width test_text"  >学历：</td>
                        <td class="TableData" width="180" >
                            <select style="width:218px;" name="STAFF_HIGHEST_SCHOOL" class="BigSelect per_xueli" title="<fmt:message code="hr.th.TheEducation" />。">
                                <option value="" selected=""></option>
                                <option value="1"><fmt:message code="vote.hr.1" /></option>
                                <option value="2"><fmt:message code="vote.hr.2" /></option>
                                <option value="3"><fmt:message code="vote.hr.3" /></option>
                                <option value="4"><fmt:message code="vote.hr.4" /></option>
                                <option value="5"><fmt:message code="vote.hr.5" /></option>
                                <option value="6"><fmt:message code="vote.hr.6" /></option>
                                <option value="7"><fmt:message code="vote.hr.7" /></option>
                                <option value="8"><fmt:message code="vote.hr.8" /></option>
                                <option value="9"><fmt:message code="vote.hr.9" /></option>
                                <option value="11"><fmt:message code="vote.hr.10" /></option>
                            </select>
                        </td>
                        <td nowrap="" class="TableData text_width"  ><fmt:message code="hr.th.AcademicDegree" />：</td>
                        <td class="TableData" colspan="3" >
                            <select style="width:218px;" name="STAFF_HIGHEST_DEGREE" class="BigSelect per_xuewei" title="<fmt:message code="hr.th.Adegree" />。">
                                <option value="" selected=""></option>
                                <option value="1"><fmt:message code="vote.hr.9" /></option>
                                <option value="2"><fmt:message code="vote.hr.8" /></option>
                                <option value="3">MBA</option>
                                <option value="4"><fmt:message code="vote.hr.13" /></option>
                                <option value="5"><fmt:message code="vote.hr.12" /></option>
                                <option value="6"><fmt:message code="vote.hr.11" /></option>
                                <option value="7"><fmt:message code="event.th.nothing" /></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td nowrap="" class="TableData text_width"  ><fmt:message code="hr.th.GraduationTime" />：</td>
                        <td class="TableData" width="180" >
                            <input type="text" name="GRADUATION_DATE" size="10" maxlength="10" class="BigInput per_overtime" value="" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})">
                        </td>
                        <td nowrap="" class="TableData text_width" ><fmt:message code="hr.th.ComputerLevel" />：</td>
                        <td class="TableData" colspan="3"><input type="text" name="COMPUTER_LEVEL" value="" class="BigInput per_shuiping"></td>
                    </tr>
                    <tr>
                        <td nowrap="" class="TableData text_width" ><fmt:message code="hr.th.GraduationSchool" />：</td>
                        <td class="TableData" width="180"><input type="text" name="GRADUATION_SCHOOL" value="" class="BigInput per_school"></td>
                        <td nowrap="" class="TableData text_width" ><fmt:message code="hr.th.major" />：</td>
                        <td class="TableData" colspan="3"><input type="text" name="STAFF_MAJOR" value="" class="BigInput per_zhuanye"></td>

                    </tr>
                    <tr>
                        <td nowrap="" class="TableData text_width" ><fmt:message code="hr.th.ForeignLanguage" />1：</td>
                        <td class="TableData" width="180"><input type="text" name="FOREIGN_LANGUAGE1" value="" class="BigInput per_yuzhongone"></td>
                        <td nowrap="" class="TableData text_width" ><fmt:message code="hr.th.ForeignLanguageProficiency" />1：</td>
                        <td class="TableData" colspan="3"><input type="text" name="FOREIGN_LEVEL1" value="" class="BigInput per_waiyuone"></td>

                    </tr>
                    <tr>

                        <td nowrap="" class="TableData text_width" ><fmt:message code="hr.th.ForeignLanguage" />2：</td>
                        <td class="TableData" width="180"><input type="text" name="FOREIGN_LANGUAGE2" value="" class="BigInput per_yuzhongtwo"></td>
                        <td nowrap="" class="TableData text_width" ><fmt:message code="hr.th.ForeignLanguageProficiency" />2：</td>
                        <td class="TableData" colspan="3"><input type="text" name="FOREIGN_LEVEL2" value="" class="BigInput per_waiyutwo"></td>
                    </tr>
                    <tr>
                        <td nowrap="" class="TableData text_width" ><fmt:message code="hr.th.ForeignLanguage" />3：</td>
                        <td class="TableData" width="180"><input type="text" name="FOREIGN_LANGUAGE3" value="" class="BigInput per_yuzhongthree"></td>
                        <td nowrap="" class="TableData text_width" ><fmt:message code="hr.th.ForeignLanguageProficiency" />3：</td>
                        <td class="TableData" colspan="3"><input type="text" name="FOREIGN_LEVEL3" value="" class="BigInput per_waiyuthree"></td>
                    </tr>
                    </tbody>
                </table>
                <div class="box_two foot_mg">
                    <div class="btn_">
                        <%--<div id="add_send" value="1" type="publish" class="fot_1 btn_ok" ac="edit">打印预览</div>--%>
                       <div id="leave_send" value="0" type="save" class="btn_style btn_ok leave_send">打印</div>
                    </div>
                </div>
            </div>


        </div>
    </div>


<script>



    //选部门
    $('.dept_add').click(function(){
        dept_id='LEAVE_DEPT';
        $.popWindow("../../../common/selectDept?0");
    });
    //选角色
    $('.userPriv_add').click(function(){
        priv_id='USER_PRIV_NAME';
        $.popWindow("../../../common/selectPriv?0");
    });
    //人员选择控件（离职人员）
    $(".leavePerson_add").on("click",function(){
        user_id='LEAVE_PERSON';
        $.popWindow("../../../common/selectUser?0");
    });
    //人员选择控件（直属上级）
    $(".add_shangji").on("click",function(){
        user_id='directlySuperiorName';
        $.popWindow("../../../common/selectUser");
    });
    //人员选择控件（直属下级）
    $(".add_xiaji").on("click",function(){
        user_id='directlyUnderName';
        $.popWindow("../../../common/selectUser");
    });
    //清空（直属上级）
    $(".clear_shangji").on("click",function(){
        $('#directlySuperiorName').val('');
        $('#directlySuperiorName').attr("dataid",'');
    });
    //人清空（直属下级）
    $(".clear_xiaji").on("click",function(){
        /*直属上级*/
        $('#directlyUnderName').val('');
        $('#directlyUnderName').attr("dataid",'');
    });







    //列表中的复选框
    $(function () {
        $('.childQuery').on('click', '#checkedAll', function () {
            var state = $(this).prop("checked");
            if (state == true) {
                $(this).prop("checked", true);
                $(".checkChild").prop("checked", true);
            } else {
                $(this).prop("checked", false);
                $(".checkChild").prop("checked", false);
            }
        })
        $('#imageFile').change(function () {
            submitPhoto();
        })

        $('.TableData').on('click','.deImgs',function () {
            var file = document.getElementById('imageFile');
            file.value = '';
            $(this).remove();
        })

        //职务下拉列表
        $.ajax({
            type: 'post',
            url: '/duties/selectUserPostList',
            dataType: 'json',
            success: function (obj) {
                var data=obj.obj;
                str="<option value='0'><fmt:message code="hr.th.PleaseSelect" /></option>";
                if(obj.flag){
                    for(var i=0;i<data.length;i++){
                        str+="<option value='"+data[i].postId+"'>"+data[i].postName+"</option>";
                    }
                }
                $(".per_zhiwu").html(str);
            }
        });
        //岗位下拉列表
        $.ajax({
            type: 'post',
            url: '/position/selectUserJob',
            dataType: 'json',
            success: function (obj) {
                var data=obj.obj;
                str="<option value='0'><fmt:message code="hr.th.PleaseSelect" /></option>";
                if(obj.flag){
                    for(var i=0;i<data.length;i++){
                        str+="<option value='"+data[i].jobId+"'>"+data[i].jobName+"</option>";
                    }
                }
                $(".per_yingpin").html(str);
            }
        });

        // 获取url中的参数
        var href = location.href;
        console.log(href);
        var obj = {};
        if(href.indexOf('?') != -1){
            var newHref = href.split('?')[1].split('&');
            console.log(newHref);
            for(var i = 0; i < newHref.length; i++){
                obj[newHref[i].split('=')[0]] = newHref[i].split('=')[1];
            }
        }

        $.ajax({
            type: 'get',
            url: '<%=basePath%>hr/api/getPersonFileByUserId',
            dataType: 'json',
            data: {
                uid: obj.uid
            },
            success: function (res) {
                var data = res;
                var str = '';
                //附件
                /*if(data.attachmentList.length>0){
                    for(var i=0;i<data.attachmentList.length;i++){
                        str+='<div class="dech" deUrl="'+data.attachmentList[i].attUrl+'"><a href="<%=basePath %>download?'+data.attachmentList[i].attUrl+'" NAME="'+data.attachmentList[i].attachName+'*"><img style="width:16px;" src="../img/file/cabinet@.png"/>'+data.attachmentList[i].attachName+'</a><img class="deImgs" style="margin-left:5px;cursor: pointer;" src="../img/file/icon_deletecha_03.png"/><input type="hidden" class="inHidden" value="'+data.attachmentList[i].aid+'@'+data.attachmentList[i].ym+'_'+data.attachmentList[i].attachId+',"></div>';
                    }
                }else{
                    str='';
                }
                $('.Attachment').append(str);*/
                $(".byName").val(data.byName);
                $(".dept_id").val(data.deptId);
                $(".uid").val(data.uid);
                $(".staffId").val(data.staffId);
                $(".user_id").val(data.userId);//userId
                $('.per_name').val(data.staffName);
                /*姓名*/
                $('.dept_name ').val(data.deptName);
                /*部门 缺少字段*/
                $('.per_health').val(data.staffHealth);
                /*健康*/
                $('.per_zhuanye').val(data.staffMajor);
                /*专业*/
                $('.per_school').val(data.graduationSchool);
                /*大学*/
                //$('.per_familyAdd').val(data.homeAddress);/*家庭住址*/
                $('.per_email').val(data.staffEmail);
                /*邮件*/
                $('.userPrivName').val(data.userPrivName);
                /*角色*/
                /*$(".userPriv").val(data.userPriv);//角色id*/
                $(".userPrivName").attr("userPriv", data.userPriv);//角色id

                $('.per_engname').val(data.staffEName);
                /*本人的英文姓名*/
                $('.per_minzu').val(data.staffNationality);
                /*民族*/
                $('.per_worknum').val(data.workNo);
                /*工号*/
                $('.per_sex').val(data.staffSex);
                /*性别*/
                $('.per_ident').val(data.staffCardNo);
                /*身份证号*/
                if(data.staffBirth=='0000-00-00'){
                    $('.per_date').val('');
                }else{
                    $('.per_date').val(data.staffBirth);
                }
                /*出生日期*/
                $('.per_age').val(data.staffAge);
                /*年龄*/
                $('.per_yearjia').val(data.leaveType);
                /*年休假 */
                $('.per_address').val(data.staffNativePlace);
                /*籍贯*/
                $('.per_detialAdd').val(data.staffNativePlace2);
                /*具体籍贯*/
                $('.per_xiexing').val(data.bloodType);
                /*血型*/
                $('.per_hunyin').val(data.staffMaritalStatus);
                /*婚姻状况*/
                $('.per_zhengzhi').val(data.staffPoliticalStatus);
                /*政治面貌*/
                if(data.joinPartyTime=='0000-00-00'){
                    $('.per_dang').val('');
                }else{
                    $('.per_dang').val(data.joinPartyTime);
                }
                /*入党时间*/
                $('.per_hukou').val(data.staffType);
                /*户口类别*/
                $('.per_hukouAdd').val(data.staffDomicilePlace);
                /*户口所在地*/
                $('.per_gongzhong').val(data.workType);
                /*工种*/
                $('.per_xingzheng').val(data.administrationLevel);
                /*行政级别 */
                $('.per_yuangongType').val(data.staffOccupation);
                /*员工类型*/
                $('.per_zhiwu').val(data.jobPosition);
                /*职务*/
                $('.per_zhicheng').val(data.presentPosition);
                /*职称*/
                if(data.datesEmployed=='0000-00-00'){
                    $('.per_ruzhiTime').val('');
                }else{
                    $('.per_ruzhiTime').val(data.datesEmployed);
                }
                /*入职时间*/
                $('.per_zhichengjibie').val(data.workLevel);
                /*职称级别*/
                $('.per_yingpin').val(data.workJob);
                /*应聘岗位*/
                $('.per_kaoqin').val(data.workNo);
                /*考勤排班类别   ====》无字段 未找到*/
                $('.per_gongling').val(data.jobAge);
                /*本单位工龄*/
                $('.per_allage').val(data.workAge);
                /*总工龄*/
                if(data.beginSalsryTime=='0000-00-00'){
                    $('.per_xinziTime').val('');
                }else{
                    $('.per_xinziTime').val(data.beginSalsryTime);
                }
                /*起薪时间 ===》找到*/
                $('.per_zaizhizhuangtai').val(data.workStatus);
                /*在职状态*/
                if(data.jobBeginning=='0000-00-00'){
                    $('.per_joinWork').val('');
                }else{
                    $('.per_joinWork').val(data.jobBeginning);
                }
                /*参加工作时间*/
                $('.per_dianhua').val(data.staffPhone);
                /*联系电话*/
                $('.per_phone').val(data.staffMobile);
                /*手机号码*/
                $('.per_msn').val(data.staffMsn);
                /*msn*/
                $('.per_jobLevel').val(data.userdef5);

                $('.per_familyAdd').val(data.homeAddress);
                /*家庭地址 */
                $('.per_elseType').val(data.otherContact);
                /*其他联系方式*/
                $('.per_yanjiu').val(data.researchResults);/*研究领域 未找到*/
                $('.per_socish').val(data.partTime);
                /*社会兼职*/
                $('.per_success').val(data.researchResults);
                /*成果介绍*/
                $('#directlySuperiorName').val(data.directlySuperiorName);
                $('#directlySuperiorName').attr("dataid",data.directlySuperior);
                /*直属上级*/
                $('#directlyUnderName').val(data.directlyUnderName);
                $('#directlyUnderName').attr("dataid",data.directlyUnder);
                /*直属下级*/
                $('.per_kaihuhang').val(data.bank1);
                /*开户行1*/
                $('.per_kaihuhangtwo').val(data.bank2);
                /*开户行2*/
                $('.zhanghuone').val(data.bankAccount1);
                /*开户行的账号1*/
                $('.zhanghutwo').val(data.bankAccount2);
                /*开户行的账号2*/
                $('.per_xueli').val(data.staffHighestSchool);
                /*学历*/
                $('.per_xuewei').val(data.staffHighestDegree);
                /*学位*/
                if(data.graduationDate=='0000-00-00'){
                    $('.per_overtime').val('');
                }else{
                    $('.per_overtime').val(data.graduationDate);
                }
                /*毕业时间*/
                $('.per_shuiping').val(data.computerLevel);
                /*计算机水平*/
                $('.per_yuzhongone').val(data.foreignLanguage1);
                /*外语语种1*/
                $('.per_yuzhongtwo').val(data.foreignLanguage2);
                /*外语语种2*/
                $('.per_yuzhongthree').val(data.foreignLanguage3);
                /*外语语种3*/
                $('.per_waiyuthree').val(data.foreignLevel1);
                /*外语水平1*/
                $('.per_waiyutwo').val(data.foreignLevel2);
                /*外语水平2*/
                $('.per_waiyuone').val(data.foreignLevel3);
                /*外语水平3*/
                $('.per_techang').val(data.staffSkills);
                /*特长*/
                $('.zhiwu').val(data.certificate);
                /*职务情况 */
                $('.danbao').val(data.surety);
                /*担保记录*/
                $('.shebao').val(data.insure);
                /*社保*/
                $('.tijian').val(data.bodyExamim);
                /*体检*/
                $('.beizhu').val(data.remark);
                /*备注*/
                $(".per_qq").val(data.staffQq);//qq
                /*简历*/
                $(".per_num").val(data.staffNo);//编号
                $(".per_overname").val(data.beforeName);//曾用名

                /*是否成为专家*/
                if(data.isExperts==1){
                    $('.isExperts').eq(0).prop("checked",true);
                }else{
                    $('.isExperts').eq(1).prop("checked",true);
                }
            }
        })

    })


    /*时间控件调用*/
    var start = {
       elem: '#STAFF_BIRTH',
        format: 'YYYY-MM-DD',
        /* min: laydate.now(), //设定最小日期为当前日期
         max: '2099-06-16 23:59:59', //最大日期*/
        istime: true,
        istoday: false,
        /* choose: function(datas){
            end.min = datas; //开始日选好后，重置结束日的最小日期
            end.start = datas; //将结束日的初始值设定为开始日
        }*/
        choose:get_animal_sign
        //回调函数
    };
    laydate(start);


    // 打印
    $("#leave_send").click(function () {
        $('.box_two').css('display', 'none');
        window.print();
        $('.box_two').css('display', '');
        return false;

    })




    function get_animal_sign(){
        var birth=$("#STAFF_BIRTH").val();
        if (birth != '' && birth != '0000-00-00') {
            $("#animal_id").val(Calculator.shengxiao(birth));
            birth = birth.replace(/-/g, "");
            var month = birth.substring(4, 6);
            var day = birth.substring(6, 8);
            $("#sign_id").val(Calculator.xingzuo(month, day));
        }
    }

    //身份证号进行校验STAFF_CARD_NO
    function  check(){
        var cardId=$("#STAFF_CARD_NO").val();
        var regIdNo = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
        if(cardId!=''){
            if(!regIdNo.test(cardId)){
                layer.msg('请输入合法的身份证号码!', {icon: 2});
                return false;
            }
            //出生日期
            var birth=cardId.substring(6, 10) + "-" + cardId.substring(10, 12) + "-" + cardId.substring(12, 14);
            $("#STAFF_BIRTH").val(birth);
            //年龄
            var myDate = new Date();
            var month = myDate.getMonth() + 1;
            var day = myDate.getDate();
            var age = myDate.getFullYear() - cardId.substring(6, 10) - 1;
            if (cardId.substring(10, 12) < month || cardId.substring(10, 12) == month && cardId.substring(12, 14) <= day) {
                age++;
            }
            $("[name='STAFF_AGE']").val(age);
        }
    }

</script>
</body>
</html>

